-- CALC_BINE_MAGIC

-- 计算魔藤魔力
-- @param bine    魔藤
return function(bine)
    local level = bine:getLevel();
    local magic;

    if level < 11 then 
        magic = math.modf(level + 14);
    elseif level < 21 then
        magic = math.modf(level * 1.5 + 9);
    else
        magic = math.modf(level * 2 - 1);
    end

    -- 1. 绝对值加成
    local prop = PropM.combine(bine, "attrib2", "magic");
    magic = PropM.apply(prop, magic);

    -- 2. 百分比加成
    prop = PropM.combine(bine, "attrib", "magic");
    magic = PropM.apply(prop, magic);

    -- 玩家属性加成
    if ME.user:queryAttrib("bine_attrib") > 0 then
        magic = magic + 3;
    end

    return magic;
end
